package sh.action;

import lombok.Data;
import sh.model.Cart;
import sh.service.CartService;

import com.opensymphony.xwork2.ActionSupport;
import sh.service.impl.CartServiceImpl;

@Data
public class CartAction extends ActionSupport{
	private Long cartId;
	private Cart cart;
	
	//查看购物车
	/*@Override
	public String execute() throws Exception {
		CartService cartService = new CartServiceImpl();
		cart = cartService.getByCartId(cartId);
		return super.execute();
	}
	*/
	
	@Override
	public String execute() throws Exception {
		CartService cartService = new CartServiceImpl();
		setCart(cartService.getByCartId(cartId));
		return super.execute();
	}
	
}
